package diary_impl

import (
	"hong/uniapp_server/domain/diary"
	"hong/uniapp_server/infrstructure/dao"
)

type DiaryRepositoryImpl struct {
	dao *dao.DiaryDao
}

func NewDiaryRepositoryImpl(diaryDao *dao.DiaryDao) *DiaryRepositoryImpl {
	return &DiaryRepositoryImpl{
		dao: diaryDao,
	}
}

func (r *DiaryRepositoryImpl) AddDiary(diary *diary.DiaryEntity) error {
	id, err := r.dao.InsertDiary(diary)
	if err != nil {
		return err
	}
	diary.ID = id
	return nil
}

func (r *DiaryRepositoryImpl) GetDiary(id int64) (*diary.DiaryEntity, error) {
	return nil, nil
}

func (r *DiaryRepositoryImpl) UpdateDiary(diary *diary.DiaryEntity) error {
	return nil
}

func (r *DiaryRepositoryImpl) DeleteDiary(id int64) error {
	return nil
}
